package com.mobdev.notepad.shared;

import android.content.ContentValues;
import android.content.Context;
import android.net.Uri;

public class UtilityMethods {
	/**
     * Utility method - marks the given note for deletion.
     *
     * @param context
     * @param uri The note's uri
     * @return The number of rows updated.
     */
    public static int markNoteForDeletion(Context context, Uri uri)
    {
    	//mark the selected note so that it will be deleted the next time sync is run
    	int now = (int) ( System.currentTimeMillis() / 1000 );

    	ContentValues values = new ContentValues();
    	//values.put(DBConstants.TITLE, "");
    	//values.put(DBConstants.CONTENTS, "");
    	//values.put(DBConstants.TAGS, "");
    	values.put(DBConstants.DELETED_FROM_PHONE, "1");
    	values.put(DBConstants.MODIFIED_ON, now);

    	int result = context.getContentResolver().update(uri, values, null, null);
    	return result;

    }
}
